<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>
			{$info['id']?'编辑':'新增'}菜单
			<notempty name="pid">
				[&nbsp;父菜单：<a href="{:U('index','pid='.$pid)}">{$parent.title}</a>&nbsp;]
			</notempty>
		</h2>
	</div>
	<form action="{:U()}" method="post" class="form-horizontal">
        <div class="with-padding">
            <div class="form-item">
                <label class="item-label">优先级<span class="check-tips">（菜单显示顺序）</span></label>
                <div class="controls">
                    <input type="text" class="text input-small form-control form-input-width" name="sort" value="{$info.sort|default='1'}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">标题<span class="check-tips">（用于显示的文字）</span></label>
                <div class="controls">
                    <input type="text" class="text input-large form-control form-input-width" name="title" value="{$info.title|default=''}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">类型<span class="check-tips">（菜单类型）</span></label>
                <div class="controls">
                    <select name="type" class="form-control form-select-size">

                        <volist name="types" id="p">
                            <option <eq name="$key" value="$info['type']" >selected</eq> value= {$key} >{$p}</option>
                        </volist>
                    </select>
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">关键词<span class="check-tips">（关联关键词）</span></label>
                <div class="controls">
                    <input type="text" class="text input-large form-control form-input-width" name="keyword" value="{$info.keyword|default=''}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">链接<span class="check-tips">（用于跳转的URL，支持带http://的URL）</span></label>
                <div class="controls">
                    <input type="text" class="text input-large form-control form-input-width" name="url" value="{$info.url|default=''}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">父菜单<span class="check-tips">（仅支持二级）</span></label>
                <div class="controls">
                    <select name="pid" class="form-control form-select-size">
                        <option <empty name="pid" > selected</empty>value="0">顶级菜单</option>
                        <volist name="pcm" id="p">
                            <option <eq name="p.id" value="$pid" >selected</eq> value="{$p.id}">{$p.title}</option>
                        </volist>
                    </select>
                </div>
            </div>

            <div class="form-item">
                <div class="controls">
                    <input type="text" class="text input-large form-control form-input-width" style="width: 100px;display: none" name="token" value={:get_token()}>
                </div>
            </div>

        </div>

		<div class="form-item with-padding">
			<input type="hidden" name="id" value="{$info.id|default=''}">
			<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>
</block>
<block name="script">
<script type="text/javascript" charset="utf-8">
	//导航高亮
	highlight_subnav('{:U('index')}');
</script>
</block>
